package com.jeff.utils.security;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * author：duff
 * version：1.0.0
 * date：2017/8/31
 * desc：
 */
public class SHA1Util {
    public static String encrypt(String s) {
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
            messageDigest.update(s.getBytes());
            return SecurityUtil.toHexString(messageDigest.digest());
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }

        return "";
    }

}
